import { Component, ViewEncapsulation } from '@angular/core';
import {CompanyService} from './company.service';
@Component({
  selector: 'company',
  encapsulation: ViewEncapsulation.None,
  styles: [],
  providers: [CompanyService],
  template: `
      <ba-sidebar></ba-sidebar>
      <ba-page-top>
         <a routerLink="/" style="color: #fff;" (click)="loginOut()"><i class="fa fa-home" aria-hidden="true"></i>首页</a>
         <a href class="signout" style="color: #fff;" (click)="loginOut()"><i class="fa fa-power-off"></i> 登出</a>
      </ba-page-top>
      <div class="al-main">
        <div class="al-content">
          <ba-content-top></ba-content-top>
          <router-outlet></router-outlet>
        </div>
      </div>
      <page-footer></page-footer>
      <ba-back-top position="200"></ba-back-top>  
  `
})
export class CompanyComponent {
  private logout = '/platform/login/logout';

  constructor(private _service: CompanyService) {
  }

  ngOnInit() {
  }

  loginOut(){
    this._service.loginOut(this.logout)
      .then(res => {
        if (res.status === 'success') {
        } else {
        }
      }, error => {
      });
  }
}
